package com.fita.admin.dao;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;
import com.fita.entity.data.ShortUrl;

/**
 * 
 * @author dan
 *
 */
@Dao("hibernate")
public interface ShortUrlDao {
    
    /**
     * 
     * @param shortUrl
     * @return
     */
    @Query("FROM ShortUrl WHERE disabled = false AND shortUrl = :shortUrl")
    public ShortUrl load(@Variable("shortUrl") String shortUrl);
    
    /**
     * 
     * @param longUrl
     * @return
     */
    @Query("FROM ShortUrl WHERE disabled = false AND longUrl = :longUrl")
    public ShortUrl loadByLongUrl(@Variable("longUrl") String longUrl);

}
